from django.db import models

from article.models import Article
from user.models import UserModel


# Create your models here.

# 用户文章点赞表
class Love(models.Model):
    lover = models.ForeignKey(UserModel,to_field='uid',related_name="user1",on_delete=models.CASCADE,db_column="lover_id")
    art= models.ForeignKey(Article,to_field='aid',related_name="article1",on_delete=models.CASCADE,db_column="art_id")

    class Meta:
        db_table = "love"
        unique_together = ["lover_id","art_id"]
        verbose_name = "点赞表"  # 在admin站点显示名称